package org.senseframework.support.orm.mybatis.query.builder;

import org.senseframework.support.orm.mybatis.definition.Update;

import java.util.ArrayList;
import java.util.List;

/**
 * Author lanjian
 * Email  jianlan@iflytek.com
 */
public class UpdateBuilder extends QueryBuilder<UpdateBuilder> {

    public static UpdateBuilder build(Class clazz) {
        return new UpdateBuilder(clazz);
    }


    protected UpdateBuilder(Class clazz) {
        super(clazz);
    }

    private List<Update> updates = new ArrayList<Update>();


    public List<Update> getUpdates() {
        return updates;
    }

    public void setUpdates(List<Update> updates) {
        this.updates = updates;
    }


    public UpdateBuilder set(String property, Object value) {
        set(property, value, updates, this);
        return this;
    }

    public UpdateBuilder set(String property, String valueAs, Object value) {
        set(property, valueAs, value, updates, this);
        return this;
    }
}
